package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.Witsmall;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/WitsmallMapper.class */
public interface WitsmallMapper {
    @Delete({"delete from witsmall where id = #{id,jdbcType=INTEGER}"})
    int deleteById(Integer num);

    @Insert({"insert into witsmall (type, witbig_num, witsmall_num, witsmall_name,depreciation)", "values (#{type,jdbcType=VARCHAR}, #{witbigNum,jdbcType=VARCHAR}, #{witsmallNum,jdbcType=VARCHAR}, ", "#{witsmallName,jdbcType=VARCHAR},#{depreciation,jdbcType=INTEGER})"})
    int add(Witsmall witsmall);

    @Select({"<script>select id, type, witbig_num, witsmall_num, witsmall_name,depreciation from witsmall <where> <if test='type != null and type.length &gt; 0 '>type = #{type,jdbcType=VARCHAR}</if></where>  ORDER BY witbig_num,witsmall_num</script>"})
    @Results({@Result(column = "witbig_num", property = "witbigNum", jdbcType = JdbcType.VARCHAR), @Result(column = "witsmall_num", property = "witsmallNum", jdbcType = JdbcType.VARCHAR), @Result(column = "witsmall_name", property = "witsmallName", jdbcType = JdbcType.VARCHAR)})
    List<Witsmall> findAll(String str);

    @Select({"<script>select id, type, witbig_num, witsmall_num, witsmall_name,depreciation from witsmall <where> <if test='witbigNum != null and witbigNum.length &gt; 0 '>witbig_num = #{witbigNum,jdbcType=VARCHAR} </if><if test='type != null and type.length &gt; 0 '>and type = #{type,jdbcType=VARCHAR} </if></where>  ORDER BY witbig_num,witsmall_num</script>"})
    @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR), @Result(column = "witbig_num", property = "witbigNum", jdbcType = JdbcType.VARCHAR), @Result(column = "witsmall_num", property = "witsmallNum", jdbcType = JdbcType.VARCHAR), @Result(column = "witsmall_name", property = "witsmallName", jdbcType = JdbcType.VARCHAR)})
    List<Witsmall> findByBnum(@Param("witbigNum") String str, @Param("type") String str2);

    @Update({"update witsmall set witsmall_name = #{witsmallName,jdbcType=VARCHAR},depreciation = #{depreciation,jdbcType=INTEGER}", "where id = #{id,jdbcType=INTEGER}"})
    int updateById(Witsmall witsmall);

    @Select({"select witsmall_num from witsmall where witbig_num = #{witbigNum,jdbcType=VARCHAR} and witsmall_name = #{witsmallName,jdbcType=VARCHAR} and type = #{type,jdbcType=VARCHAR}"})
    @Results({@Result(column = "witsmall_num", property = "witsmallNum", jdbcType = JdbcType.VARCHAR)})
    String findOneByName(@Param("type") String str, @Param("witbigNum") String str2, @Param("witsmallName") String str3);

    @Select({"select depreciation from witsmall where witbig_num = #{witbigNum,jdbcType=VARCHAR} and witsmall_num = #{witsmallNum,jdbcType=VARCHAR} and type = #{type,jdbcType=VARCHAR}"})
    Integer findDepreciation(@Param("type") String str, @Param("witbigNum") String str2, @Param("witsmallNum") String str3);

    @Select({"select witsmall_name from witsmall where witbig_num = #{witbigNum,jdbcType=VARCHAR} and witsmall_num = #{witsmallNum,jdbcType=VARCHAR} and type = #{type,jdbcType=VARCHAR}"})
    @Results({@Result(column = "witsmall_name", property = "witsmallName", jdbcType = JdbcType.VARCHAR)})
    String findOneByNum(@Param("type") String str, @Param("witbigNum") String str2, @Param("witsmallNum") String str3);

    @Select({"<script>select id, type, witbig_num, witsmall_num, witsmall_name,depreciation from witsmall <where> <if test='id != null '>id = #{id}</if></where> </script>"})
    @Results({@Result(column = "witbig_num", property = "witbigNum", jdbcType = JdbcType.VARCHAR), @Result(column = "witsmall_num", property = "witsmallNum", jdbcType = JdbcType.VARCHAR), @Result(column = "witsmall_name", property = "witsmallName", jdbcType = JdbcType.VARCHAR)})
    Witsmall findById(Integer num);

    @Select({"select count(*) from witsmall where witbig_num = #{witbigNum,jdbcType=VARCHAR} and witsmall_name = #{witsmallName,jdbcType=VARCHAR} and type = #{type,jdbcType=VARCHAR}"})
    Integer findByName(@Param("type") String str, @Param("witbigNum") String str2, @Param("witsmallName") String str3);
}